home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group94b.txt
/
000132_nevin@caslon _Mon Dec 5 05:58:11 1994.msg
< prev
next >
Wrap
Internet Message Format
|
1995-02-09
|
3KB
Received: from optima.CS.Arizona.EDU by cheltenham.CS.Arizona.EDU; Mon, 5 Dec 1994 05:58:16 MST
Received: from caslon.CS.Arizona.EDU by optima.CS.Arizona.EDU (5.65c/15) via SMTP
id AA28193; Mon, 5 Dec 1994 05:58:15 MST
Received: (nevin@localhost) by caslon.CS.Arizona.EDU (8.6.7/8.6.4) id FAA00432 for icon-group@cs.arizona.edu; Mon, 5 Dec 1994 05:58:13 -0700
From: Nevin Liber <nevin@caslon>
Message-Id: <199412051258.FAA00432@caslon.CS.Arizona.EDU>
Subject: Icon debugging tip
To: icon-group@cs.arizona.edu (Icon Group)
Date: Mon, 5 Dec 1994 05:58:11 -0700 (MST)
X-Mailer: ELM [version 2.4 PL23]
Content-Type: text
Content-Length: 2193
Since I'm currently working on a fairly large project, I thought I'd
share one of the debugging tips that I'm using.
I need to be able to control on a procedure by procedure basis which
procedures should output debugging information, and which ones
shouldn't. Additionally, I want to be able to easily turn off all the
embedded debugging code when I am done.
First, I have a global variable gTfDebug, which is a table of files.
Next, given a procedure Peachfuzz(x1, x2) where I wish to write a line of
debugging output every time it is invoked, I would add the following
line of code to Peachfuzz:
write(\gTfDebug[Peachfuzz], repl(" ", &level),
"Peachfuzz(", image(x1), ", ", image(x2), ")")
[Note: the reason that I have the repl(" ", &level) is to visually
show how many levels deep the procedure call is. This has the added
benefit of lining up debugging output for the same instance of a call;
ie, I might want to print out the suspended or returned values. I use
image() to make sure that the debugging code never has a run time
error, even if the parameters aren't exactly what was expected.]
Now, I would put the following as my first statement in main():
1) I want all procedures to write their debugging output to &errout:
gTfDebug := table(&errout)
2) I want no debugging output:
gTfDebug := table()
3) I want only Rocky() and Bullwinkle() to produce debugging output:
gTfDebug := table()
every gTfDebug[Rocky | Bullwinkle] := &errout
4) I want everything except Boris() and Natasha() to produce debugging output:
gTfDebug := table(&errout)
every gTfDebug[Boris | Natasha] := &null
Etc., etc.
Hopefully, someone else will find this helpful!
--
Nevin ":-)" Liber nevin@cs.arizona.edu (602) 293-2799
^^^ (520) after 3/95
___ _ ____ _ ___
/ \__/ \__/ \__/ \__/ \ "Hey Rocky!
| _|@ @ __ | Watch me pull some intelligence
\________/ | | \________/ out of the internet!"
__/ _/ "But that trick never works."
/) (o _/ "This time for sure."
\____/